package com.atguigu.upp.mapper;

import com.atguigu.upp.bean.TaskTagRule;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by Smexy on 2023/1/3
 */
public interface TaskTagRuleMapper
{
    // 根据taskId查询当前task所计算的tag的四级标签映射规则
    @Select(" SELECT" +
        "   tag_name subTagValue,t2.*" +
        "   FROM" +
        "   (SELECT id,`tag_name` FROM tag_info) t1" +
        "   JOIN" +
        "   (SELECT * FROM `task_tag_rule` WHERE `task_id`= #{id}) t2" +
        "   ON t1.id = t2.sub_tag_id")
    List<TaskTagRule> getRulesByTaskId(@Param("id") String taskId);
}
